
GO
/****** Object:  StoredProcedure [PBDsk_InsertFeedNewsItem]    Script Date: 12/22/2010 14:58:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [PBDsk_InsertFeedNewsItem]
			@pChannelID			int
           ,@pTitle				varchar(1000)
           ,@pDescription		varchar(256)
           ,@pLink				varchar(1000)
           ,@pPubDate			smalldatetime
           ,@pAuthor			varchar(512)
           ,@pIsActive			bit
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
BEGIN TRANSACTION InsertNewsItem
	INSERT INTO [PBDsk_FeedNewsItem]
           ([Title]
           ,[Description]
           ,[Link]
           ,[PubDate]
           ,[Author]
           ,[IsActive] )
     VALUES
           (@pTitle
           ,@pDescription
           ,@pLink
           ,@pPubDate
           ,@pAuthor
           ,@pIsActive)



	INSERT INTO [PBDsk_FeedChannelNewsItem]
           ([ChannelID]
           ,[NewsItemID]
           ,[IsActive])
     VALUES
           (@pChannelID
           ,IDENT_CURRENT('PBDsk_FeedNewsItem')
           ,@pIsActive)

COMMIT TRANSACTION  InsertNewsItem         
           
END